package grg.learn.compose.wanandroid.config

import grg.learn.compose.network.RetrofitCreate
import grg.learn.compose.wanandroid.data.model.IndexArticlePage
import grg.learn.compose.wanandroid.data.model.IndexBanner
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Path

interface WanAndroidApiService {

    @GET("/article/list/{page}/json")
    suspend fun indexArticle(@Path("page") path: String): Result<IndexArticlePage>

    /**
     * create by iso88591 at 2021/9/3
     * banner
     */
    @GET("/banner/json")
    suspend fun indexBanner(): Result<List<IndexBanner>>

    companion object {
        val INSTANCE by lazy {
            RetrofitCreate.retrofitProvider().retrofit("https://www.wanandroid.com")
                .create(WanAndroidApiService::class.java)
        }
    }

}

